#ifndef __MARS_GRAPHICS_SAMPLER_STATE_H__
#define __MARS_GRAPHICS_SAMPLER_STATE_H__

#include "MarsObject.h"
#include "MarsMacro.h"

using namespace Core;

namespace Graphics
{

class SamplerState : public Object
{
public:
									SamplerState( const D3D11_SAMPLER_DESC& samplerDesc );
									~SamplerState();

	bool							Create();
	void							Delete();

	ID3D11SamplerState*				GetNativeSamplerState() const;

private:
	D3D11_SAMPLER_DESC				m_samplerDesc;
	ID3D11SamplerState*				m_pSampler;
};

inline SamplerState::SamplerState( const D3D11_SAMPLER_DESC& samplerDesc )
	: m_pSampler( NULL )
{
	MARS_MEMCPY( &m_samplerDesc, &samplerDesc, sizeof( D3D11_SAMPLER_DESC ) );
}

inline SamplerState::~SamplerState()
{
	Delete();
}

inline ID3D11SamplerState* SamplerState::GetNativeSamplerState() const
{
	return m_pSampler;
}

} // end of namespace Graphics

#endif // end of #ifndef __MARS_GRAPHICS_SAMPLER_STATE_H__